package com.ctshk.rpc.hotel.entity.es;

import com.ctshk.common.constant.ElasticSearchConstant;
import com.ctshk.rpc.hotel.dto.booking.HotelBookingRoomDTO;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.time.LocalDate;
import java.util.List;

/**
 * @description 酒店详情
 * @author 谢诗宏
 * @date 2021/4/20
 */
@Data
@ApiModel(description="预订中心酒店详情dto")
@Document(indexName = ElasticSearchConstant.HOTEL_DETAIL_INDEX)
public class HotelDetailEs implements Serializable {

    private static final long serialVersionUID = 3202416599280723045L;

//    @Field(type = FieldType.Long)
    @ApiModelProperty(value = "id")
    private Long id;

    @ApiModelProperty(value = "酒店来源")
    private Integer sourceType;

    @ApiModelProperty(value = "酒店名称")
    private String name;

    @ApiModelProperty(value = "英文名称")
    private String enName;

    @ApiModelProperty(value = "联系电话")
    private String telephone;

    @ApiModelProperty(value = "联系邮箱")
    private String email;

    @ApiModelProperty(value = "国家名称")
    private String countryName;

    @ApiModelProperty(value = "省名称")
    private String provinceName;

    @ApiModelProperty(value = "城市名称")
    private String cityName;

    @ApiModelProperty(value = "详细地址")
    private String location;

    @ApiModelProperty(value = "邮政编码")
    private String postalCode;

    @ApiModelProperty(value = "酒店位置名称")
    private String businessDistrictName;

    @ApiModelProperty(value = "酒店位置描述")
    private String locToDistrictDistance;

    @ApiModelProperty(value = "酒店主题JSON")
    private String hotelThemeJson;

    @ApiModelProperty(value = "酒店类型ID")
    private Long hotelTypeId;

    @ApiModelProperty(value = "酒店类型名称")
    private String hotelTypeName;

    @ApiModelProperty(value = "酒店楼层数量")
    private Integer floorNum;

    @ApiModelProperty(value = "酒店房间总数")
    private Integer roomNum;

    @ApiModelProperty(value = "酒店星级", example = "5")
    private Integer starLevel;

    @ApiModelProperty(value = "酒店星级说明", example = "五星級/豪華型")
    private String starLevelExplain;

    @ApiModelProperty(value = "酒店图片JSON")
    private String showPhotoJson;

    @ApiModelProperty(value = "经度", example = "114.0684")
    private String lng;

    @ApiModelProperty(value = "纬度", example = "22.53751")
    private String lat;

    @ApiModelProperty(value = "酒店房型列表数据")
    private List<HotelBookingRoomDTO> hotelRooms;

    @ApiModelProperty(value = "酒店介绍")
    private String hotelContent;

    @ApiModelProperty(value = "酒店开业时间")
    private String openingTime;

    @ApiModelProperty(value = "最后装修时间")
    private String finalRenovationTime;

    @ApiModelProperty(value = "酒店设施")
    private String hotelFacilities;

    @ApiModelProperty(value = "酒店政策")
    private String hotelPolicy;

    @Field(type = FieldType.Date,
            format = DateFormat.custom,
            pattern = "yyyy-MM-dd")
    @JsonFormat(shape = JsonFormat.Shape.STRING,
            pattern = "yyyy-MM-dd",
            timezone = "GMT+8")
    @ApiModelProperty(value = "入住日期", example = "2021-05-01")
    private LocalDate checkInDate;

    @Field(type = FieldType.Date,
            format = DateFormat.custom,
            pattern = "yyyy-MM-dd")
    @JsonFormat(shape = JsonFormat.Shape.STRING,
            pattern = "yyyy-MM-dd",
            timezone = "GMT+8")
    @ApiModelProperty(value = "离店日期", example = "2021-05-03")
    private LocalDate checkOutDate;

    @ApiModelProperty(value = "成人数", example = "2")
    private Integer adultNum;

    @ApiModelProperty(value = "小童数-没有传0", example = "4", required = true)
    private Integer childrenNum;

}
